package verticle;

import io.netty.handler.codec.http2.Http2Connection;
import io.rsocket.ConnectionSetupPayload;
import io.rsocket.RSocket;
import io.rsocket.RSocketFactory;
import io.rsocket.SocketAcceptor;
import io.rsocket.frame.decoder.PayloadDecoder;
import io.rsocket.transport.netty.server.TcpServerTransport;
import io.vertx.core.http.HttpServerOptions;
import io.vertx.reactivex.core.AbstractVerticle;
import reactor.core.publisher.Mono;

/**
 * BackEndVerticle
 *
 * @author liyixin
 * @date 2019/6/5
 */
public class BackEndVerticle extends AbstractVerticle {

    @Override
    public void start() {
//        RSocketFactory.receive()
//                // Enable Zero Copy
//                .frameDecoder(PayloadDecoder.ZERO_COPY)
//                .acceptor((setup, sendingSocket) -> {
//
//                    return null;
//                })
//                .transport(TcpServerTransport.create(7878))
//                .start()
//                .block()
//                .onClose()
//                .block();



        HttpServerOptions options = new HttpServerOptions();

        vertx.createHttpServer(options).requestHandler(req -> {
            req.handler(v -> {}).endHandler(v -> req.response().end());
        }).listen(90);
    }
}
